const nodata = require('../tw-lib-base/no-data/props')
const commonProps = require('../tw-lib-base/chart/common-props')
// const axisProps = require('../tw-lib-base/chart/axis-props')
// const datazoomProps = require('../tw-lib-base/chart/datazoom-props')
const tooltipProps = require('../tw-lib-base/chart/tooltip-props')

module.exports = {
  ...commonProps,

  // ...axisProps,
  // ...datazoomProps,
  ...tooltipProps,

  data: {
    type: Array,
    default () {
      return [
        ['外环', '数值'],
        ['语文', 43.3],
        ['数学', 83.1],
        ['英语', 86.4],
        ['物理', 84.4]
      ]
    },
    name: '外图表数据集',
    filedType: 'api'
  },

  datainner: {
    type: Array,
    default () {
      return [
        ['饼图', '数值'],
        ['综合', 63.3],
        ['评价', 83.1]
      ]
    },
    name: '内图表数据集',
    filedType: 'api'
  },


  innerRadius: {
    type: String,
    default: '35%',
    name: '环图内半径',
    filedType: 'string'
  },
  outerRadius: {
    type: String,
    default: '50%',
    name: '环图外半径',
    filedType: 'string'
  },
  showLabel: {
    type: Boolean,
    default: false,
    name: '显示外环标签',
    filedType: 'switch'
  },
  outerLabelColor: {
    type: String,
    default: '',
    name: '外环图标签颜色',
    filedType: 'color'
  },
  outerLabelFontSize: {
    type: String,
    default: '',
    name: '外环图标签字体',
    filedType: 'string'
  },
  positionLabel: {
    type: String,
    default: 'outside',
    name: '标签位置',
    filedType: 'string'
  },
  formatterLabel: {
    type: String,
    default: '{b}\n{c}\n{d}%',
    name: '标签格式',
    filedType: 'string'
  },
  funcOuterLabel: {
    type: Function,
    default: '',
    name: '外环图标签函数',
    filedType: 'function'
  },
  radiusLength: {
    type: String,
    default: '30%',
    name: '内饼图半径',
    filedType: 'string'
  },
  showInnerLabel: {
    type: Boolean,
    default: true,
    name: '显示内饼图标签',
    filedType: 'switch'
  },
  innerLabelColor: {
    type: String,
    default: '',
    name: '内饼图标签颜色',
    filedType: 'color'
  },
  innerLabelFontSize: {
    type: String,
    default: '',
    name: '内饼图标签字体',
    filedType: 'string'
  },

  funcInnerLabel: {
    type: Function,
    default: 'function tmpinnerfunc (value) {if (params.percent < 10) { return ""; } else if (params.name.length > 4) {return params.name.substring(0, 4) + "...";} return params.name;}',
    name: '内饼图标签函数',
    filedType: 'function'
  },
  triggerType: {
    type: String,
    default: 'item',
    name: '触发类型',
    filedType: 'string'
  },

  showAxis: {
    type: Boolean,
    default: false,
    name: '显示坐标轴',
    filedType: 'switch'
  },

  useCustomLabel: {
    type: Boolean,
    default: false,
    name: '富文本定制外环标签',
    filedType: 'switch'
  },
  customLabel: {
    type: String,
    default: '%7B%22show%22%3Atrue%2C%22formatter%22%3A%22%7Ba%7C%7Ba%7D%EF%BC%9A%7D%20%7Bb%7C%7Bb%7D%7D%20%7Babg%7C%7D%5Cn%7Bhr%7C%7D%5Cn%20%20%E6%95%B0%E9%87%8F%EF%BC%9A%7Bc%7C%7Bc%7D%7D%20%20%7Bper%7C%7Bd%7D%25%7D%20%22%2C%22backgroundColor%22%3A%22%23fff%22%2C%22borderColor%22%3A%22%23aaa%22%2C%22borderWidth%22%3A0.4%2C%22borderRadius%22%3A5%2C%22rich%22%3A%7B%22a%22%3A%7B%22color%22%3A%22%23666%22%2C%22lineHeight%22%3A30%2C%22padding%22%3A%5B0%2C7%5D%2C%22align%22%3A%22center%22%7D%2C%22hr%22%3A%7B%22borderColor%22%3A%22%23aaa%22%2C%22width%22%3A%22100%25%22%2C%22borderWidth%22%3A0.2%2C%22height%22%3A0%7D%2C%22b%22%3A%7B%22color%22%3A%22%23666%22%7D%2C%22c%22%3A%7B%22fontSize%22%3A14%2C%22lineHeight%22%3A30%7D%2C%22per%22%3A%7B%22color%22%3A%22%23666%22%2C%22backgroundColor%22%3A%22%23f4f4f4%22%2C%22fontSize%22%3A14%2C%22padding%22%3A%5B2%2C4%5D%2C%22lineHeight%22%3A30%2C%22borderRadius%22%3A2%7D%7D%7D',
    name: '富文本定制Label',
    filedType: 'string'
  },
  showLabelLine: {
    type: Boolean,
    default: true,
    name: '显示外环标签线',
    filedType: 'switch'
  },
  labelLineLength: {
    type: String,
    default: '10',
    name: '外环标签线长度',
    filedType: 'string'
  },
  labelLineLength1: {
    type: String,
    default: '10',
    name: '外环标签线1长度',
    filedType: 'string'
  },

  componentIndex: {
    type: String,
    default: '0',
    name: '点击区域',
    filedType: 'select',
    options: [
      {
        name: '内饼图',
        value: '1'
      },
      {
        name: '外环图',
        value: '0'
      }
    ]
  },
  value: {
    type: String,
    default: 'undefined',
    name: '选中饼图块',
    filedType: 'value',
    dataSource: {
      from: 'list',
      type: 'array',
      labelKey: 'label',
      valueKey: 'value'
    }
  },

  useBlankCilck: {
    type: Boolean,
    default: false,
    name: '启用空白区域点击',
    filedType: 'switch'
  },
  outerBlankRadius: {
    type: String,
    default: '100%',
    name: '环图外空白区域半径',
    filedType: 'string'
  },
  extendOption: {
    type: Boolean,
    default: false,
    name: '扩展定制option',
    filedType: 'switch'
  },
  funcExtOption: {
    type: Function,
    default: '',
    name: '扩展定制option函数',
    filedType: 'function'
  },
  isPhone: {
    type: Boolean,
    default: false,
    name: '移动端使用',
    filedType: 'switch'
  },

  ...nodata
}
